﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace LHWebApp
{
    public partial class changpassword : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            UserInfo userInfo = Session["CurrentUserInfo"] as UserInfo;
            if (userInfo == null)
                Response.Redirect("loginNew.html");

            if (!IsPostBack)
            {
                Response.ContentType = "text/plain";
                string userName = userInfo.UserName;
                string passWord = Request.Params["LoginPass"];
                if (Services.ChangPassword(userName, passWord))
                {
                    Response.Write("{success:true,reason:'修改成功!',action:'1'}");
                }
                else
                    Response.Write("{failure:true,reason:'修改失败!',action:'1'}");

            }
        }
    }
}
